package entity;

/**
 * @author Yanren Long
 */
public class Edge {
	
	private static final int EDGE_PIXEL_MARGIN = 7;
	
	/** Position of the line at left end side of the edge. */
	int left;
	
	/** Position of the edge on the vertical direction. */
	int height;
	
	/** Position of the line at right end side of the edge. */
	int right;
	
	/** 
	 * This method compares the attributes of the edges to check if they conflict with each other.
	 */
	public boolean conflictWith(Edge e){
	    	
		if (e.left == left){
	    	if(Math.abs(e.height - height) <= EDGE_PIXEL_MARGIN) {
    			return true;
	    	}
	    }
	    	
    	return false;
	    	
	}
	    
	public Edge(int left, int height, int right) {
			super();
			this.left = left;
			this.height = height;
			this.right = right;
	}

	public int getLeft() {
		return left;
	}

	public int getHeight() {
		return height;
	}

	public int getRight() {
		return right;
	}
	
	public static int getEdgePixelMargin(){
		return EDGE_PIXEL_MARGIN;
	}
	
	
	    
}
